﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="../../../Scripts/easyUI145/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/easyUI145/jquery.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/easyUI145/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../../Scripts/config.js" type="text/javascript"></script>
    <script src="../../../Comm/JScript.js" type="text/javascript"></script>
    <script src="../../../Scripts/CommonUnite.js" type="text/javascript"></script>
    <script src="../../../Scripts/EasyUIUtility.js" type="text/javascript"></script>
    <script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../../Comm/Gener.js" type="text/javascript"></script>
    <!-- 自己的系统风格统一. -->
    <link href="../../../Style/skin/adminfont/iconfont.css" rel="stylesheet" />
    <link href="../../../Style/skin/css/Default.css" rel="stylesheet" />
    <!-- 自己的系统风格统一end -->
    <script src="DDLBar.js" type="text/javascript"></script>
    <script src="../../CCFlowEnum.js" type="text/javascript"></script>
    <style type="text/css">

        select[disabled], input[type=text]:disabled {
            width: auto;
            padding-left: 10px;
            border: thin solid #CCCCCC;
            background: none;
            text-align: left;
            color: #666;
            cursor: no-drop;
            appearance: none;
            -moz-appearance: none;
            -webkit-appearance: none;
        }
    </style>
    <script type="text/javascript">

        $(function () {
            InitBar(FormSlnType.ChapterFrm);
            var html = "";
            //获取节点属性
            var nodeID = GetQueryString("FK_Node");

            var node = new Entity("BP.WF.Node", nodeID);
            //node.SetPKVal(nodeID);
            //s node.Retrieve();
            // console.log(node);
            //alert(node.Name);
            //return;

            //获取节点方案的表单引用值 frmIDSelected为空时为 0当前节点表单，1 其他表单
            var frmIDSelected = node.NodeFrmID;
            if (frmIDSelected == "" || frmIDSelected == null)
                frmIDSelected = "ND" + nodeID;

            var seledtNodeID = frmIDSelected.replace('ND', '');

            var nodeFrmID = node.NodeFrmID;
            var frmID = "ND" + nodeID;
            var mapData = new Entity("BP.Sys.MapData", frmID);

            var nodes = new Entities("BP.WF.Nodes");
            nodes.Retrieve("FK_Flow", node.FK_Flow);


            //增加slect的节点值
            GenerBindDDL("DDL_Frm", nodes, "NodeID", "Name", seledtNodeID);

            //表单引用设置
            if (node.FormType == FormSlnType.FoolForm) {

                if (node.NodeFrmID == "" || node.NodeFrmID == null) {
                    document.getElementById("RB_CurrentForm").checked = true;
                    SetDDLEnable('DDL_Frm', 'enable');
                } else if (node.NodeFrmID == "Pri") {
                    document.getElementById("RB_Pri").checked = true;
                }
                else {
                    document.getElementById("RB_OtherForms").checked = true;
                    SetDDLEnable('DDL_Frm', 'disable')
                }
            }

        });

        function SetDDLEnable(ctrl, val) {
            if (val == "enable")
                $("#" + ctrl).attr("disabled", "disabled");
            else
                $("#" + ctrl).removeAttr("disabled");
        }

        function Save() {
            $("#Btn_Save").html("正在保存...");

            //更新节点表单类型.
            var nodeID = GetQueryString("FK_Node");
            var node = new Entity("BP.WF.Node", nodeID);
            node.FormType = FormSlnType.ChapterFrm;
            var frmValue = $("input[name='RefFrm']:checked").val();

            if (frmValue == "0") {
                node.NodeFrmID = "";
            }
            if (frmValue == "1") {
                node.NodeFrmID = "ND" + $("#DDL_Frm ").val();
            }

            //上一个节点表单.
            if (frmValue == "2") {
                node.NodeFrmID = "Pri";
            }

            node.Update();

            //更新表单类型.
            var frmID = "ND" + nodeID;
            var mapData = new Entity("BP.Sys.MapData", frmID);
            mapData.FrmType = FrmType.ChapterFrm; //  章节表单.;
            mapData.Update();

            //设置显示的主表单,在完成的流程轨迹里可以看到该表单.
            SetNDxxRpt_FrmType(node.FK_Flow, 0);

            $("#Btn_Save").html("保存成功");
        }


        //节点表单组件属性.
        function ShowFWCAttr() {
            var nodeID = GetQueryString("FK_Node");
            var url = "../../../Comm/EnOnly.htm?EnName=BP.WF.Template.FrmNodeComponent&PKVal=" + nodeID;
            OpenEasyUiDialogExt(url, '节点表单组件', 800, 450, false);
        }
        function BatchFWC() {
            var nodeID = GetQueryString("FK_Node");
            var flowNo = GetQueryString("FK_Flow");

            var url = "../../AttrFlow/BatchFWC.htm?FK_Flow=" + flowNo + "&NodeID=" + nodeID;
            OpenEasyUiDialogExt(url, '批量设置', 800, 450, false);
        }

        function OneKeySetting() {
            var msg = "";
            msg += "您确定要设置审核组件模式吗？ ";
            msg += "\t\n 1,第2个节点以后的节点表单都指向第2个节点表单. ";
            msg += "\t\n 2,结束节点都设置为只读模式.";

            if (window.confirm(msg) == false)
                return;

            var nodeID = GetQueryString("FK_Node");
            var node = new Entity("BP.WF.Node", nodeID);

            var flow = new Entity("BP.WF.Template.FlowExt", node.FK_Flow);
            var str = flow.DoMethodReturnString("DoSetFWCModel");
            alert(str);

        }
        /**/</script>
</head>
<body>
    <div class="cs-content-box">
        <div id="bar" class="cs-tr cs-bar"> </div>

        <fieldset>
            <legend>
                <input type="radio" value="0" id="RB_CurrentForm" checked="true" onclick="SetDDLEnable('DDL_Frm','enable')" name="RefFrm" />
                <label for="RB_CurrentForm">当前节点表单 </label>
            </legend>
            <ul>
                <li>每个节点都有一个独立表单</li>
                <li>在创建节点的时候默认的为当前节点表单.</li>
                <li><a href="javascript:DFoolFrm()">设计傻瓜表单</a></li>
                <li class="cs-green">该表单风格可以通过改变\DataUser\Style\ccbpm.css文件改变</li>
            </ul>
        </fieldset>


        <fieldset>
            <legend>
                <input type="radio" value="1" id="RB_OtherForms" onclick="SetDDLEnable('DDL_Frm','disable')" name="RefFrm" />
                <label for="RB_OtherForms">关联引用其他节点表单</label>
            </legend>
            <br />
            选择节点: <select id="DDL_Frm" name="DDL_Frm" disabled="disabled"> </select>

            <legend>高级设置</legend>
            <ul>
                <li>
                    <a href="javascript:BatchFWC()">批量设置审核组件状态 </a>
                </li>

                </li>
                <li>
                    <a href="javascript:ShowFWCAttr()">节点表单组件属性</a>
                </li>
                <li>
                    <a href="javascript:OneKeySetting()">一键设置审核组件模式</a>
                </li>
            </ul>

            <strong style="color:#ff0000">说明</strong>
            <ul>
                <li>当前节点可以引用其他节点的表单.</li>
                <li>一般流程都符合1，2规律. 这个1，2规律是:开始节点填写表单, 第2个节点是只读的，第2个以后都是审批节点。</li>
                <li>对于符合1，2规律的流程模式设计步骤如下</li>
                <li>1: 设计开始表单. </li>
                <li>2: 把该表单导入到第2个节点上去，然后把字段设置为只读。 </li>
                <li>3: 在第2个节点上拖入一个审核组件，并设置为启用状态(审核组件有禁用，启用，只读三个状态) </li>
                <li>4: 在第3个节点以及第3个节点以后，设置为引用第2个节点的表单,并把审核组件启用起来.</li>
            </ul>
        </fieldset>

        <fieldset>
            <legend>
                <input type="radio" value="2" id="RB_Pri" name="RefFrm" />
                <label for="RB_Pri">有上一个节点表单来确定</label> - <a href="javascript:ShowFWCAttr()">节点表单组件属性</a>
            </legend>
            <ul>
                <li>1.当前节点可以引用其上一个节点的表单.</li>
                <li>2.如果上一个节点表单也是引用的上一个节点表单，那么系统就会依次类推的去寻找第一个当前节点表单.</li>
            </ul>
        </fieldset>

        <fieldset>
            <legend class="form-instructor">样式说明</legend>
            <ul>
                <li>PC该表单有4个列,设计简单方便.</li>
                <li> 属性模式，如下图: </li>
                <li><img src='./Img/ChapterFrm1.png' style="width:80%;" class="HelpImg" /> </li>
                <li> 大文本模式，如下图: </li>
                <li><img src='./Img/ChapterFrm2.png' style="width:80%;" class="HelpImg" /> </li>
                <li> 从表模式，如下图: </li>
                <li><img src='./Img/ChapterFrm3.png' style="width:80%;" class="HelpImg" /> </li>
                <li> 附件模式，如下图: </li>
                <li><img src='./Img/ChapterFrm4.png' style="width:80%;" class="HelpImg" /> </li>
            </ul>
        </fieldset>

    </div>
</body>
</html>
